/*
 分类相关接口
*/

import request from '@/utils/request'

/**
 * @description 获取首页头部分类数据
 * @return Promise
 */
export const findAllCategory = () => {
  return request('/home/category/head', 'get')
}

/**
 * @description 获取单个顶级分类信息
 * @param {String} id
 * @return Promise
 */
export const findTopCategory = id => {
  return request('/category', 'get', { id })
}

/**
 * @description 获取二级分类筛选条件数据
 * @param {String} id
 * @return Promise
 */
export const findSubCategoryFilter = id => {
  return request('/category/sub/filter', 'get', { id })
}

/**
 * @description 获取分类下的商品（带筛选条件）
 * @param {Object} params
 * @return Promise
 */
export const findSubCategoryGoods = params => {
  return request('/category/goods/temporary', 'post', params)
}
